# Contributor: Curt Tilmes <Curt.Tilmes@nasa.gov>
# Maintainer: Curt Tilmes <Curt.Tilmes@nasa.gov>
pkgname=nqp
pkgver=2024.09
pkgrel=0
pkgdesc="Not Quite Perl"
url="https://github.com/Raku/nqp"
arch="all"
options="!archcheck" # Arch dependencies are embedded
license="Artistic-2.0"
depends="moarvm~$pkgver"
makedepends="perl-utils moarvm-dev~$pkgver"
checkdepends="perl-test-harness"
subpackages="$pkgname-doc"
source="https://github.com/Raku/nqp/releases/download/$pkgver/nqp-$pkgver.tar.gz"

build() {
	perl Configure.pl --prefix=/usr --backends=moar
	make -j"$JOBS"
}

check() {
	export TEST_JOBS=$JOBS
	export HARNESS_VERBOSE=1

	msg "Running $TEST_JOBS parallel test jobs"
	make test
}

package() {
	make DESTDIR="$pkgdir" install

	install -Dvm644 CREDITS LICENSE README.pod VERSION \
		-t "$pkgdir"/usr/share/doc/"$pkgname"
	cp -vr docs examples "$pkgdir"/usr/share/doc/"$pkgname"/
}

sha512sums="
6d152a25404de819197ea89b28b4411ffd4ef11932d8af1f02300958ecd1d323c10ab03711a5332fb48728be3e022bab8400bd662c4e06fc061df382b34c630e  nqp-2024.09.tar.gz
"
